<?php
/**
 * 控制器类
 *
 * @author: prettyyjnic <prettyyjnic@qq.com> 2015-11-25
 */

class Yjnic_Controller {

	protected $_view = NULL;

	public function __construct(){
		$view_configs = DI()->config->get('app.view');
		if (empty($view_configs)) {
			throw new Exception("View configs ['app.view'] is empty", 501);			
		}
		$this->_view = new Yjnic_View($view_configs);

		defined('TEMPLATE_PATH') || define('TEMPLATE_PATH', APP_PATH . '/Template');		
		$this->_view->assign('template_path', WEB_PATH. '/' . APP_NAME . '/' . basename( $view_configs['path']) ); //模板所在地址
		$this->_view->assign('public_path',   WEB_PATH . '/Public'); //公共文件夹所在地址
	}

}
